package edu.gmu.projects.fireresponder.gui;

import java.util.Calendar;

import edu.gmu.projects.fireresponder.environment.Location;
import edu.gmu.projects.fireresponder.xml.alerts.FirstResponderAlert;

public class ResponderMessage implements Comparable<ResponderMessage> {
	
	private String message;
	private String senderId;
	private Calendar timeStamp;
	private Location location;
	
	public ResponderMessage(FirstResponderAlert alert) {
		this.senderId = alert.getResponder().getId();
		this.location = alert.getLocation();
		this.message = alert.getMessage();
		this.timeStamp = alert.getTime();
	}
	
	public void setSenderId(String senderId) {
		this.senderId = senderId;
	}

	public String getSenderId() {
		return senderId;
	}
	
	public void setTimeStamp(Calendar timeStamp) {
		this.timeStamp = timeStamp;
	}

	public Calendar getTimeStamp() {
		return timeStamp;
	}
	
	public void setLocation(Location location) {
		this.location = location;
	}

	public Location getLocation() {
		return location;
	}
	
	public void setMessage(String message) {
		this.message = message;
	}

	public String getMessage() {
		return message;
	}

	public int compareTo(ResponderMessage another) {
		return this.timeStamp.compareTo(another.timeStamp);
	}
}
